package com.example.medicalrecord.AggregationModule.registered.controller;

import com.example.medicalrecord.AggregationModule.registered.pojo.dto.RegisteredQuery;
import com.example.medicalrecord.AggregationModule.registered.pojo.vo.RegisteredVo;
import com.example.medicalrecord.AggregationModule.registered.service.RegisteredService;
import com.example.medicalrecord.base.response.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/registered/")
public class RegisteredController {
@Autowired
    RegisteredService registeredService;

@GetMapping("selectByDoctorId")
    public JsonResult selectByDoctorId(RegisteredQuery registeredQuery){
    log.debug("查询医生id对应的挂号单：registeredQuery={}",registeredQuery);
    List<RegisteredVo> list = registeredService.selectByDoctorId(registeredQuery);
    return JsonResult.ok(list);
}

}
